// import { AlbumQuery } from "../App";
import useData from "./useData";
import { generateAlbumWithStaticId, Album } from "@/faker/album/albums";

const useAlbum = (id: number) => {
  const fetchAlbum = async (id: number) => {
    return await generateAlbumWithStaticId(id);
  };

  const { data, error, isLoading } = useData<Album>(
    `/albums/${id}`,
    {
      params: {
        // 这里可以添加其他参数，如果需要的话
      },
    },
    [id]
  );

  return { data, error, isLoading, fetchAlbum };
};

export default useAlbum;
